//
//  File.swift
//  
//
//  Created by ellzu gu on 2021/9/3.
//

import Foundation

public extension Result {
    
    func getError() -> Failure? {
        if case .failure(let error) = self {
            return error
        }
        return nil
    }
    
    func getValue() -> Success? {
        guard case .success(let v) = self else {
            return nil
        }
        return v
    }
}
